package com.desire.homework;

/**
 * @author desire
 */
public class _08_控制台输出菱形 {
    public static void main(String[] args) {
        int s = 3;
        for (int i = 1; i <= 5; i += 2) {  //i1        i3         i5
            s--;                           //s2        s1         s0
            for (int k = 0; k < s; k++) {  //k(01) s2  k0  s1     k0 !< s0
                System.out.print("0");
            }
            for (int j = 1; j <= i; j++) { //j1 i1     j(123) i3  j(12345) i5
                System.out.print("*");
            }
            System.out.println();
        }

        for (int i = 3; i > 0; i -= 2) {     //i3         i1
            s++;                             //s1         s2
            for (int k = 0; k < s; k++) {    //k0 s1      k(01) s2
                System.out.print("0");
            }
            for (int j = 1; j <= i; j++) {   //j(123) i3  j1 i1
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
